#include "umainwindow.h"
#include "utexteditwidget.h"
#include "udialogwidget.h"
#include <QUdpSocket>
#include <QVBoxLayout>


UMainWindow::UMainWindow(QWidget *parent)
    : QWidget(parent)
    , m_pTextEditBox(new UTextEditWidget(this))
    , m_pDialogBox(new UDialogWidget(this))
{
    setWindowTitle("客户端");
    setAttribute(Qt::WA_StyledBackground, true);
    setWindowFlags(Qt::NoDropShadowWindowHint);// 设置为无边框窗口
    resize(850, 700);
    m_pDialogBox->move(0, 0);
    m_pTextEditBox->move(0, 460);

    setStyleSheet(R"(UMainWindow{background-color:#FFFFFF;border-radius:4px;border:1px solid #D9D8D7;border:none;})");
    connect(m_pTextEditBox, &UTextEditWidget::sendText, m_pDialogBox, &UDialogWidget::displayMessage); //在dialogBox展示消息
}

UMainWindow::~UMainWindow()   
{}
